Skip to content

Conversation

@kmorinCL
Copy link

@kmorinCL kmorinCL commented Oct 5, 2025

It's a POC. I am a noob in Python, I hope I did the things right.
I added the open-elevation in the config, I don't know if it'd rather be configurable in the admin UI.

@SamR1
Copy link
Owner

SamR1 commented Oct 5, 2025

Hi!

Thanks for the PR.

I'll take a look in the next few days.
In the meantime, is it possible to make changes from dev branch? (see CONTRIBUTING.md)
Thanks.

@kmorinCL kmorinCL changed the base branch from main to dev October 7, 2025 10:04
@SamR1
Copy link
Owner

SamR1 commented Oct 8, 2025

Hi!

I added the open-elevation in the config, I don't know if it'd rather be configurable in the admin UI.

It's OK to set the URL in .env (as with other services).

Some quick feedback:

  • the changes are made in WorkoutFitService, so only workouts created from a .fit file have their elevation updated.
  • tests are missing.

I can make the changes if you prefer :)

@kmorinCL
Copy link
Author

kmorinCL commented Oct 8, 2025

I would have added the tests when you validated the principle of my PR (I am a real noob in python, I never wrote tests, nore an API mock in pyhton, so it would have taken time I guess to write and rewrite the tests).
I do not know why, but I can't launch fittrackee locally anymore... If you do not mind, I would appreciate that you make the changes.

@SamR1
Copy link
Owner

SamR1 commented Oct 8, 2025

no worries, I'll make the changes :)

I do not know why, but I can't launch fittrackee locally anymore...

What is the error encountered?

@kmorinCL
Copy link
Author

kmorinCL commented Oct 8, 2025

I have this error:
2:04:31 PM [vite] Internal server error: Failed to resolve import "vue-leaflet-markercluster" from "src/components/Workouts/WorkoutsMap.vue". Does the file exist?

@SamR1
Copy link
Owner

SamR1 commented Oct 8, 2025

If you are working without docker, run the following command to install Javascript dependencies (vue-leaflet-markercluster was introduced in version 1.0.0):

$ make install-client-dev

With docker, the command is:

$ make docker-build-client

@kmorinCL
Copy link
Author

kmorinCL commented Oct 9, 2025

I was working with docker and already ran this command, but it still does not work. Maybe I screwed something with my branch.

@SamR1
Copy link
Owner

SamR1 commented Oct 11, 2025

Can you remove the container and re-build the image ?

To remove the container:

$ docker container rm fittrackee_client

@SamR1
Copy link
Owner

SamR1 commented Oct 11, 2025

I made some changes (not pushed yet) and tests with a gpx file (before and after removing elevation from file):

  • original file:
Elevation Chart Workout Data
image image
  • file after removing all elevation data before upload and with elevations added by OpenElevation:
Chart Workout Data
image image

This adds about 1 km (and therefore 1 km/h to the speed for this workout). The elevation gain is multiplied by 2.73.

I made another branch but with strm.py to test it instead of using OpenElevation:

Chart Workout Data
image image

And with smooth option:

Chart Workout Data
image image

With smooth option, the data (distance, speed, elevation gain) are closer to the original file.

Compared to OpenElevation solution, it is not possible to configure the data source (and therefore change it if it is no longer available, for example). To get elevation, strm.py downloads data locally which can take up space, depending on the option selected.

The ideal solution would be to be able to reprocess the data from OpenElevation in order to "smooth" it.
I'll see if I can do something about this after I finish another refactoring of the file processing currently in progress.

@SamR1 SamR1 added the v1.1.x Issues planned in versions 1.1.x label Nov 11, 2025
@SamR1 SamR1 marked this pull request as draft November 11, 2025 15:12
@SamR1
Copy link
Owner

SamR1 commented Nov 11, 2025

Hi,

I pushed my changes (sorry for the delay):

  • rebase on v1.1.x branch
  • move changes from WorkoutFitService to WorkoutGpxService, as all services inherit from WorkoutGpxService
  • add smooth processing adapted from SciPy Cookbook (Smoothing of a 1D signal, with flat window). There may be other methods, unfortunately, I am not familiar with this kind of data processing.
  • add a user preference to allow the user to choose the processing method. By default, no method is set.

If I use the example from before (gpx file):

  • original file:
Elevation Chart Workout Data
image image
  • file after removing all elevation data before upload and with elevations added by OpenElevation (raw data)
Elevation Chart Workout Data
image image
  • file after removing all elevation data before upload and with elevations added by OpenElevation (smoothed data)
Elevation Chart Workout Data
image image

Changes in user preferences:

OpenElevation API URL is set OpenElevation API URL is not set
image image

@SamR1
Copy link
Owner

SamR1 commented Nov 11, 2025

@kmorinCL I have only tested with .gpx and .tcx files (since they are easy to modify).
Can you try with .fit files? Thank you in advance :).

@kmorinCL
Copy link
Author

kmorinCL commented Nov 25, 2025

I will try to test it soon. Thanks for your work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api client enhancement v1.1.x Issues planned in versions 1.1.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants